package com.lin.operatorlogrecord.config;

import com.lin.operatorlogrecord.factory.SpringMvcEnumConvertFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author: chenghao.lin
 * @Date: 2023/09/27
 * @Description:
 */
@Configuration
@EnableWebMvc
public class SpringMvcConfig implements WebMvcConfigurer {

    @Override
    public void addFormatters(FormatterRegistry registry) {
        registry.addConverterFactory(new SpringMvcEnumConvertFactory());
    }
}
